import pandas as pd
df = pd.read_excel('店铺数据.xlsx')
df['评价数'] = df['评价数'].str.replace('条评价', '').astype('int')
df['均价'] = df['均价'].str.replace('人均：', '').str.replace('元', '').astype('int')
df['所在区'] = df['所在区'].str.strip()
df = df.rename({'均价': '均价(元/人)'}, axis='columns')
print(df)


print('处理重复值前数据的行数: ', len(df))
df.drop_duplicates(subset=['店名'], inplace=True, ignore_index=True)
print('处理重复值后数据的行数: ', len(df))
print(df)


print('处理缺失值前数据的行数: ', len(df))
df.dropna(inplace=True,ignore_index=True)
print('处理缺失值后数据的行数: ', len(df))
print(df)

